import axios from "@/utils/request";

export const getUserList = (params) => {
  return axios.get("/users", { params });
};
export const postUserList = (params) => {
  return axios.post("/users", params);
};
//改变用户状态
export const changeStateUserList = (params) => {
  return axios.put(`/users/${params.id}/state/${params.type}`);
};
//编辑用户
export const setUserList = (id, params) => {
  return axios.put(`/users/${id}`, params);
};
//删除用户
export const deleteUserList = (id) => {
  return axios.delete(`/users/${id}`);
};
//分配用户职位
export const roleUserList = (id, params) => {
  return axios.put(`/users/${id}/role`, params);
};
//分配用户职位列表
export const rolesUserList = () => {
  return axios.get("/roles");
};
